"""

Computational Economics
06: Native Data Types
http://johnstachurski.net/lectures/ndts.html

    Here is a coded message:

    coded_message = "Olih#lv#wrr#lpsruwdqw#wr#eh#wdnhq#vhulrxvo|1"

    And here is the map to decode it:

    {'#': ' ',
     '1': '.',
     'O': 'L',
     'd': 'a',
     'e': 'b',
     'h': 'e',
     'i': 'f',
     'l': 'i',
     'n': 'k',
     'o': 'l',
     'p': 'm',
     'q': 'n',
     'r': 'o',
     's': 'p',
     'u': 'r',
     'v': 's',
     'w': 't',
     'x': 'u',
     '|': 'y'}


"""

coded_message = "Olih#lv#wrr#lpsruwdqw#wr#eh#wdnhq#vhulrxvo|1"
decoded_message = ''

decoder = {
    '#': ' ',
    '1': '.',
    'O': 'L',
    'd': 'a',
    'e': 'b',
    'h': 'e',
    'i': 'f',
    'l': 'i',
    'n': 'k',
    'o': 'l',
    'p': 'm',
    'q': 'n',
    'r': 'o',
    's': 'p',
    'u': 'r',
    'v': 's',
    'w': 't',
    'x': 'u',
    '|': 'y'
}

for l in coded_message:
    decoded_message += decoder[l]

print """
    coded message: %s
    decoded message: %s
""" % (coded_message, decoded_message)



print '%s: ok' % (__file__)
